from .build import TransformLoader


@TransformLoader.register()
class Compose:
    def __init__(self, transform_config):
        self.transforms = [TransformLoader.get(child_transform_config) for child_transform_config in transform_config['transforms']]

    def __call__(self, data):
        for transform in self.transforms:
            data = transform(data)
        return data
